const fs = require('fs');

const path = require('path');

const {P_SERIES} = require('./constans');

module.exports=function(mode){

  let filePath,json;

  if(mode===P_SERIES){

    filePath=path.join(__dirname,'../lib/p_series.json');

  }else{

    filePath=path.join(__dirname,'../lib/s_series.json');

  }

  let content = fs.readFileSync(filePath,'utf8');

  try {

    json = JSON.parse(content)

  } catch (error) {
  }

  return json;
  
}
